#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m;
int a[N];

void solve() {
  cin >> n >> m;
  rep(i, 1, n) {
    int x;
    cin >> x;
    a[i] = (n + 1 - i) * x;
  }
  sort(a + 1, a + n + 1);
  int i = 0, sum = 0;
  while (i < n && sum + a[i + 1] <= m) {
    i++;
    sum += a[i];
  }
  cout << i;
  return;
}
int main() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}